﻿@namespace MudBlazor.Docs.Examples

<MudPaper Height="200px" Class="mud-theme-primary" Style="overflow:hidden; position:relative;">
    <MudDrawerContainer Class="mud-height-full">
        <MudDrawer @bind-Open="@openStart" Anchor="Anchor.Start" Elevation="0" Variant="@DrawerVariant.Persistent">
            <MudDrawerHeader>
                <MudText Typo="Typo.h6">My App</MudText>
            </MudDrawerHeader>
            <MudNavMenu>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.Store">Store</MudNavLink>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.LocalLibrary">Library</MudNavLink>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.Forum">Community</MudNavLink>
            </MudNavMenu>
        </MudDrawer>
        <MudDrawer @bind-Open="@openEnd" Fixed="false" Anchor="Anchor.End" Elevation="0" Variant="@DrawerVariant.Persistent">
            <MudDrawerHeader>
                <MudText Typo="Typo.h6">Settings</MudText>
            </MudDrawerHeader>
            <MudNavMenu>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.AccountBox">Profile</MudNavLink>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.ShoppingCart">Orders</MudNavLink>
                <MudNavLink Match="NavLinkMatch.All" Icon="@Icons.Filled.History">Order History</MudNavLink>
            </MudNavMenu>
        </MudDrawer>
        <div class="d-flex justify-center align-center mud-height-full">
            <MudButton Color="Color.Inherit" OnClick="@ToggleStartDrawer" StartIcon="@(Rtl ? Icons.Filled.East : Icons.Filled.West)" Class="mx-2">Toggle start</MudButton>
            <MudButton Color="Color.Inherit" OnClick="@ToggleEndDrawer" EndIcon="@(Rtl ? Icons.Filled.West : Icons.Filled.East)" Class="mx-2">Toggle end</MudButton>
        </div>
    </MudDrawerContainer>
</MudPaper>

@code
{
    [CascadingParameter]
    public bool Rtl { get; set; }

    bool openStart = false;
    bool openEnd = false;

    void ToggleStartDrawer()
    {
        openStart = !openStart;
    }

    void ToggleEndDrawer()
    {
        openEnd = !openEnd;
    }
}
